package com.example.wanxiang.repository;

import com.example.wanxiang.entity.Message;
import lombok.Value;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MessageRepository extends MongoRepository<Message,String> {

    Page<Message> findByChatId(String chatId, Pageable pageable);

    long countMessageByChatId(String chatId);


}
